<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let person={
            name:'张三'
        }
        const p =new Proxy(person,{
            get(target,propName){
                //return target[propName]    //读取属性
                return Reflect.get(target,proName)
            },
            set(target,propName,value){
                //target[propName]=value  //就算没有的属性 也能加上 而vue2那个只能修改
                Reflect.set(target,proName,value)
            },
            deleteProperty(target,propName)
            {
                //return delete target[propName]
                 Reflect.deleteProperty(target,propName)
                  //一般删除成功就会返回true
            }

        })
    </script>
</body>
</html>